import { JXDef } from "../../../conventions/JXCommon";
import { GCtrl } from "../../../Core/GCtrl";
import GViewBase from "../../../Core/GView/GViewBase";
import { AudioMgr } from "../../../Core/Manager/AudioMgr";
import { CMsg, ComonTip, CURRENCY, ITEM_TYPE, PILL, PointInfo, SPECIALWINDOW } from "../../Common/Define";
import { L } from "../../Common/Language";
import { VIEW_ID } from "../../Common/UI";
import { Res } from "../../Common/UIResources";
import { JXLocales } from "../../Common/Zh";
import RJXItem from "../../Data/RunTime/RunRaw/RJXItem";
import GameMgr from "../../Logic/GameMgr";
const { ccclass, property, menu } = cc._decorator;
@ccclass @menu('View/Common/ComonTipView')
export default class ComonTipView extends GViewBase {

    @property({ type: cc.Label, tooltip: "标题昵称" }) tillab: cc.Label = null;

    @property({ type: cc.Node, tooltip: "通用Node" }) comonNode: cc.Node = null;
    @property({ type: cc.Node, tooltip: "兑换码" }) codeNode: cc.Node = null;
    @property({ type: cc.Node, tooltip: "修改昵称" }) nameNode: cc.Node = null;
    @property({ type: cc.Node, tooltip: "银币兑换" }) yinbiNode: cc.Node = null;
    @property({ type: cc.Node, tooltip: "规则说明" }) ruleNode: cc.Node = null;
    @property({ type: cc.Node, tooltip: "邮件详情" }) emailNode: cc.Node = null;
    @property({ type: cc.Node, tooltip: "武将详情" }) shuxingNode: cc.Node = null;
    @property({ type: cc.Node, tooltip: "排行奖励" }) rankReardNode: cc.Node = null;


    /** 1兑换码， 2修改昵称 3银币兑换, 4规则说明, 5邮件详情*/
    public cruType:number = 0;

    onGStart(type:number = 0, til:string = "") {
        this.cruType = type;

        this.comonNode.active = false;
        this.codeNode.active = false;
        this.nameNode.active = false
        this.yinbiNode.active = false
        this.ruleNode.active = false;
        this.emailNode.active = false
        this.shuxingNode.active = false
        this.rankReardNode.active = false

        this.bgImage.node.height = 398

        if (this.cruType == ComonTip.code){
            this.codeNode.active = true;
            this.tillab.string = "兑换码"
        }
        else if (this.cruType == ComonTip.name){
            this.nameNode.active = true
            this.tillab.string = "修改昵称"
        }
        else if (this.cruType == ComonTip.yinbi){
            this.bgImage.node.height = 498
            this.yinbiNode.active = true
            this.tillab.string = "锻造银币"
        }
        else if (this.cruType == ComonTip.ruleBtn){
            this.bgImage.node.height = 628
            this.ruleNode.active = true
            this.tillab.string = "规则说明"
        }
        else if (this.cruType == ComonTip.email){
            this.bgImage.node.height = 736
            this.emailNode.active = true
            this.tillab.string = "邮件详情"
        }
        else if (this.cruType == ComonTip.shuxing){
            this.bgImage.node.height = 722
            this.shuxingNode.active = true
            this.tillab.string = "武将详情"
        }
         else if (this.cruType == ComonTip.rankReard){
            this.bgImage.node.height = 722
            this.rankReardNode.active = true
            this.tillab.string = "排行奖励"
        }
        if(til != ""){
            this.tillab.string = til;
        }
    }

    start() {


    }


    close() {
        this.onClose();
    }
}
